/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package retemia;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.Writer;
import java.net.Socket;
import retemia.Server;

/**
 *
 * @author paolo
 */
public class Client {
    public static void main(String[] args) throws IOException{
        InputStream in=null;
        BufferedReader bin=null;
        Socket sock=null;
        OutputStream out=null;
        PrintWriter print=null;

        try{
            sock= new Socket("127.0.0.1", 5155);
            in= sock.getInputStream();
            out= sock.getOutputStream();
            print= new PrintWriter(out, true);
            print.println("Prova");
            bin= new BufferedReader(new InputStreamReader(in));
            String[] line=new String[10];
            int i=0;
            while((line[i]= bin.readLine())!=null && i<9){
                i++;
            }
            for(i=0; i<line.length; i++){
                System.out.println(line[i]);
            }
        }catch(IOException e){
            System.err.print(e);
        }finally{
            if(sock!=null){
                sock.close();
            }
        }
    }
}
